function ConvertTo-PlainText {
    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipeline, HelpMessage = 'Converts SecureString to String.')][SecureString]$SecureString
    )
    return [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString))

    <#
    .SYNOPSIS
        Converts SecureString to String.
    .DESCRIPTION
        Converts SecureString to String.
    .EXAMPLE
        PS C:\> ConvertTo-SecureString -String "pswrd" -AsPlainText -Force | ConvertTo-PlainText
        
        pswrd
    .INPUTS
        SecureString.
    .OUTPUTS
        String.
    .PARAMETER SecureString
        A 'SecureString' that should be converted to a normal string.
        Required?                    false
        Position?                    
        Default value                
        Accept pipeline input?       true
        Accept wildcard characters?  false
    #>
}